<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <title>Your Admin Panel</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


    <!-- jQuery AND jQueryUI -->
    <script type="text/javascript" src="/asserts/js/libs/jquery/1.6/jquery.min.js" th:src="@{/asserts/js/libs/jquery/1.6/jquery.min.js}"></script>
    <script type="text/javascript" src="/asserts/js/libs/jqueryui/1.8.13/jquery-ui.min.js"  th:src="@{/asserts/js/libs/jqueryui/1.8.13/jquery-ui.min.js}"></script>

    <!-- Compressed Version
        <link type="text/css" rel="stylesheet" href="min/b=CoreAdmin&f=css/reset.css,css/style.css,css/jqueryui/jqueryui.css,js/jwysiwyg/jquery.wysiwyg.old-school.css,js/zoombox/zoombox.css" />
        <script type="text/javascript" src="min/b=CoreAdmin/js&f=cookie/jquery.cookie.js,jwysiwyg/jquery.wysiwyg.js,tooltipsy.min.js,iphone-style-checkboxes.js,excanvas.js,zoombox/zoombox.js,visualize.jQuery.js,jquery.uniform.min.js,main.js"></script>
        -->
    <link rel="stylesheet" href="/asserts/css/min.css" th:href="@{/asserts/css/min.css}" />
    <script type="text/javascript" src="js/min.js" th:src="@{/asserts/js/min.js}"></script>

    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" th:href="@{https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css}">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js" th:src="@{https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js}"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js" th:src="@{https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js}"></script>

</head>

<body>

<script type="text/javascript" src="content/settings/main.js"th:src="@{/asserts/content/settings/main.js}"></script>
<link rel="stylesheet" href="content/settings/style.css" th:href="@{/asserts/content/settings/style.css}" />

<form>


        <!--            
              CONTENT 
                        -->
        <div id="content" class="white">
            <div>
                <h1 style="display: inline-block;"><img th:src="@{/asserts/img/icons/posts.png}" alt="" /> ImageTable</h1>
                <form method="post" th:action="@{/manager/imageui}" class="form-inline">
                    <table style="width: 500px; margin: 0 auto;">
                        <tr>

                            <td>
                                <label>名称</label>
                                <input type="text" name="image_name"th:value="${qb.image_name}"/>
                            </td>
                            <td> 状态：</td>
                            <td>
                                <select name="image_status">
                                    <option value="">请选择状态</option>
                                    <option value="已审核" th:selected="${qb.image_status=='已审核'}">已审核</option>
                                    <option value="未审核" th:selected="${qb.image_status=='未审核'}">未审核</option>
                                </select>
                            </td>
                            <td><button type="submit">查询</button></td>
                        </tr>
                    </table>
                </form>
            </div>
            <div class="bloc">
                <div class="title">
                    图片信息
                </div>
                <div class="content">
                    <table>
                        <thead>
                            <tr>
                                <th><input type="checkbox" class="checkall" /></th>
                                <th>图片id</th>
                                <th>图片名称</th>
                                <th>图片类型</th>
                                <th>查看次数</th>
                                <th>点赞次数</th>
                                <th>发布时间</th>
                                <th>发布人</th>
                                <th>审核人</th>
                                <th>图片状态</th>
                                <th>审核结果</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr th:each="image:${pb.list}">
                                <td><input type="checkbox" /></td>
                                <td th:text="${image.image_id}"></td>

                                <td th:text="${image.image_name==null?'':image.image_name}"></td>
                                <td th:text="${image.imageType==null?'':image.imageType.type_name}"></td>
                                <td th:text="${image.image_play}"></td>
                                <td th:text="${image.image_good}"></td>
                                <td th:text="${#dates.format(image.image_time,'yyyy-MM-dd HH:mm:ss')}"></td>
                                <td th:text="${image.user==null?'':image.user.user_name}"></td>
                                <td th:text="${image.manager==null?'':image.manager.manager_name}"></td>
                                <td th:text="${image.image_status}"></td>
                                <td th:text="${image.image_pass_status}"></td>


                                <td>
                                    <a th:href="@{/image/passui(image_id=${image.image_id})}"  th:if="${image.image_status=='未审核'}">审核</a>
                                </td>
                            </tr>

                        </tbody>
                        <tfoot>
                        <tr class="pagination">
                            <td colspan="4" align="center">
                                <ul>
                                    <li style="display: inline-flex;list-style: none"><a th:href="@{/image/imageui(currentPage=${pb.pageNum-1})}">&laquo;</a></li>
                                    <!--1 2 3 4 5 应该循环查询pages:总页码
                                     url传值： /mananer/listui?currentPage=1
                                    -->

                                    <li  style="display: inline-flex;list-style: none" th:class="${pb.pageNum==i?'active':''}" th:each="i:${#numbers.sequence(1,pb.pages)}"><a th:href="@{/image/imageui(currentPage=${i})}" th:text="${i}"></a></li>

                                    <li  style="display: inline-flex;list-style: none"><a th:href="@{/image/imageui(currentPage=${pb.pageNum+1})}">&raquo;</a></li>
                                </ul>

                            </td>

                        </tr>


                        </tfoot>
                    </table>

                    </div>
                </div>
            </div>


            </div>
        </div>


    </form>

<script>
    //@{/manager/listui(currentPage=${i})}
    //index:表示的是页码
    function goPage(index){

        //将当前页的信息保存到隐藏域中
        searhForm.currentPage.value=index;
        //可以以js的方式进行表单提交
        searhForm.submit();
    }
</script>
</body>

</html>